﻿/// <reference path="~/Scripts/jquery-vsdoc-cn.js" />
var objID = "a";
var IsShow = true;
function ShowNav() {
    if (!IsShow) {
        top.fstMain.cols = "269,*";
        IsShow = true;
        ShowNavSpan.innerHTML = "隐藏导航栏";
    }
    else {
        top.fstMain.cols = "0,*";
        IsShow = false;
        ShowNavSpan.innerHTML = "显示导航栏";
    }
}

function InitNews(obj) {
    var oEditor = FCKeditorAPI.GetInstance(objID);
    oEditor.InsertHtml('<img src="' +obj + '" />');
    //$("#" + objID).val(obj);
    $.layerclose("sentence");
}

function InitLogo(obj) {
    //var oEditor = FCKeditorAPI.GetInstance(objID);
    //oEditor.InsertHtml('<img src="' + obj + '" />');
    $("#" + objID).val(obj);
    $.layerclose("sentence");
}

function InitPicture(obj) {
    $("#" + objID).val(obj.title.replace("双击选择该图片,该图片地址为:", ""));
    ClosePictureDiglog();
}

function initFile(obj) {
    $("#" + objID).val(obj);
    hidePopWin();
}
function OpenPictureDialog1(_editName, _width, _height) {
    ///<summary>
    /// 图片选择对话框
    ///</summary>
    objID = _editName;
    showPopWin('Plus/Picture/main.aspx', _width, _height, null);
}

function ShowPictureDialog(filepath, _width, _height) {
    showPopWin(filepath, _width, _height, null);
}

function OpenUpload(_editName, _width, _height) {
    ///<summary>
    /// 图片选择对话框
    ///</summary>
    objID = _editName;
    $.layerSetup({
        id: "sentence",
        title: '图片选择',
        content: '<iframe src="Picture/Upload.aspx?uploadfiles=productm" width="100%" height="' + _height + 'px" frameborder="no" scrolling="no"></iframe>',
        isbg: true,
        height: _height,
        width: _width,
        templete: '<div class="mini_title" id="@moveid@"><span class="mini_close_btn"><a href="javascript:void(null);" class="layerclose">关闭</a></span><span class="mini_title_content"><span id="@titleid@"></span></span></div><div class="mini_content"><div class="showwint_mini_content_content" id="@contentid@"></div></div>'
    });
    $.layershow();
}
function OpenUpload1(_editName, _width, _height) {
    ///<summary>
    /// 图片选择对话框
    ///</summary>
    objID = _editName;
    $.layerSetup({
        id: "sentence",
        title: '图片选择',
        content: '<iframe src="Picture/UploadLogo.aspx?uploadfiles=productm" width="100%" height="' + _height + 'px" frameborder="no" scrolling="no"></iframe>',
        isbg: true,
        height: _height,
        width: _width,
        templete: '<div class="mini_title" id="@moveid@"><span class="mini_close_btn"><a href="javascript:void(null);" class="layerclose">关闭</a></span><span class="mini_title_content"><span id="@titleid@"></span></span></div><div class="mini_content"><div class="showwint_mini_content_content" id="@contentid@"></div></div>'
    });
    $.layershow();
}
function OpenPictureDialog(_editName, _width, _height) {
    ///<summary>
    /// 图片选择对话框
    ///</summary>
    objID = _editName;
    $.layerSetup({
        id: "sentence",
        title: '图片选择',
        content: '<iframe src="Picture/Picture_Manage_Dialog.aspx?uploadfiles=productm" width="100%" height="' + _height + 'px" frameborder="no" scrolling="no"></iframe>',
        isbg: true,
        height: _height,
        width: _width,
        templete: '<div class="mini_title" id="@moveid@"><span class="mini_close_btn"><a href="javascript:void(null);" class="layerclose">关闭</a></span><span class="mini_title_content"><span id="@titleid@"></span></span></div><div class="mini_content"><div class="showwint_mini_content_content" id="@contentid@"></div></div>'
    });
    $.layershow();
}

function OpenPictureFckDialog(_editName, _width, _height) {
    alert("开发当中");
}

function ClosePictureDiglog() {
    $.layerclose("sentence");
}
function outpic(picPath) {
    /// <summary>
    ///  显示产品缩略图
    /// </summary>
    overlib("<img src='" + picPath + "' width='200'>", CAPTION, "", FGCOLOR, '#fcfcfc', BGCOLOR, '#0080C0', CAPCOLOR, '#ffffff', BORDER, 1, CLOSETEXT, 'Close');
}

$(document).ready(function() {
    //loading
    $('#loadingContainer').ajaxStart(function() {
        $(this).show();
        $('#loadingbackground').show().css({ "opacity": "0.5" });
    }).ajaxStop(function() {
        $(this).hide();
    });
    $(".listtable").addClass("table");
    $(".listtable tr td").addClass("TR_BG_list");

    $(".listtable .headertext td").addClass("TR_BG");
    $(".listtable .headertext th").addClass("TR_BG");

    $(".edittable").addClass("table");
    $(".edittable tr td").addClass("TR_BG_list");
    //隔行显示
    $(".listtable tr").mouseover(function() {
        $(this).addClass("over");
    }).mouseout(function() {
        $(this).removeClass("over");
    });
});
//全选 反选
function SelectAll(tempControl) {
    var ball = tempControl;
    xState = ball.checked;
    elem = ball.form.elements;
    for (i = 0; i < elem.length; i++)
        if (elem[i].type == "checkbox" && elem[i].id != ball.id) {
        if (elem[i].checked != xState) {
            elem[i].click();
        }
    }
}
